import {Input, View} from "@tarojs/components";
import Taro from "@tarojs/taro";
import './index.scss'
import {useState} from "react";

function Index() {
  //输入框的值绑定
  const [state ,setState ] = useState({
    name:'',
    num:''
  })
  const inputHandler = (e,name)=>{
    setState(({
      ...state,[name]:e.target.value
    }))
  }


  //点击更换
  const btn = ()=>{
    Taro.navigateBack()
  }
  return (
    <View>
      <View style={{backgroundColor:'#fff',height:'80px',lineHeight:'80px'}}>
        <View className='iconfont icon-xiangzuo' style={{position:'absolute',top:'0',left:'0',fontSize:'22px',paddingTop:'6px',display:'flex'}}
              onClick={()=>Taro.navigateBack()}>
          <View style={{fontSize:'14px',paddingLeft:'4px'}}>更换收款账号</View>
        </View>
        <View style={{textAlign:'center',width:'100%'}}></View>
      </View>
      <View className='list'>
        <View className='item'>
          <View className='title'>收款支付宝姓名</View>
          <View>
            <Input onInput={(e)=>{inputHandler(e,'name')}}></Input>
          </View>
        </View>
        <View className='item'>
          <View className='title'>收款支付宝账号</View>
          <View>
            <Input onInput={(e)=>{inputHandler(e,'num')}}></Input>
          </View>
        </View>
      </View>
      <View className='btn' onClick={btn}>确认</View>
    </View>
  );

}

export default Index;
